Repeat (number) Times
The Repeat (number) Times form of the Repeat statement repeats a group of statements a specified number of times.SYNTAX
repeat integer [ times ] [ statement ]... end [ repeat ]whereinteger is an integer that specifies the number of times to repeat the statements in the body of the loop. The word
times
after integer is optional.statement is any AppleScript statement.
EXAMPLE
The following example numbers the paragraphs of a document with the Repeat (number) Times form of the Repeat statement.
tell document "List" set numParagraphs to (count paragraphs) set paragraphNum to 1 repeat numParagraphs times set paragraph paragraphNum to (paragraphNum as string) & " " ÿ & paragraph paragraphNum set paragraphNum to paragraphNum + 1 end repeat end tell